Repository navigation
fix(spanner): reject numeric and mid-identifier dollar-quoted string tags - #15071
Open
sakthivelmanii wants to merge 1 commit into
Open
sakthivelmanii wants to merge 1 commit into
sakthivelmanii wants to merge 1 commit into
Conversation
…tags Align PostgreSQL-dialect dollar-quoted string tag recognition in the Spanner client statement parser with PostgreSQL lexical rules: - Reject non-empty dollar-quote tags that begin with a digit (such as `$1$` or `$10$`) so positional parameters adjacent to `$` are not misinterpreted as string literal delimiters. - Ignore `$` characters immediately preceded by an unquoted identifier character (such as `col$tag$a` or `col$$`) so valid PostgreSQL identifiers containing `$` do not open false dollar-quoted string literals and mask subsequent query parameters, comments, or `RETURNING` clauses.
Contributor
There was a problem hiding this comment.
Code Review
This pull request refactors the PostgreSQL dollar-quoted string parsing logic in AbstractStatementParser to prevent positional parameters (such as $1) and mid-identifier dollar signs from being incorrectly parsed as dollar-quote tags. It introduces stricter validation using isValidIdentifierFirstChar and ensures a dollar-quoted literal cannot open immediately after an identifier character. Comprehensive unit tests have been added to StatementParserTest to validate these changes. No review comments were provided, so there is no additional feedback.
This branch has not been deployed
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Align PostgreSQL-dialect dollar-quoted string tag recognition in the Spanner client statement parser with PostgreSQL lexical rules:
$1$or$10$) so positional parameters adjacent to$are not misinterpreted as string literal delimiters.$characters immediately preceded by an unquoted identifier character (such ascol$tag$aorcol$$) so valid PostgreSQL identifiers containing$do not open false dollar-quoted string literals and mask subsequent query parameters, comments, orRETURNINGclauses.